#define  _CRT_SECURE_NO_WARNINGS 
#include<stdio.h>
void swap(int* p, int* dest, int cur)
{
	int temp = 0;
	temp = *(p + (++*dest));
	*(p + (*dest)) = *(p + cur);
	*(p + cur) = temp;
}
int main()
{
	int arr[] = { 0,8,4,2,0,0,4,0,3 };
	int cur = 0;
	int dest = -1;
	for (cur = 0, dest = -1; cur < sizeof(arr) / 4; cur++)
	{
		if (arr[cur])
		{
			swap(arr, &dest, cur);
		}
	}
	int i = 0;
	for (i = 0; i < 9; i++)
		printf("%d", arr[i]);
	return 0;
}